import { Component } from 'react';
import { Outlet } from 'react-router-dom';
import { Tabbar } from 'react-vant';
import { WapHomeO, ShoppingCartO, UserO } from '@react-vant/icons';
import WithRouter from '../../router/withRouter';
class Index extends Component {
    state = {
    }
    render() {
        return (
            <div>
                <Outlet></Outlet>
                <Tabbar activeColor='rgb(238, 10, 36)' onChange={(active) => {
                    
                    switch (active) {
                        case 0:
                            this.props.router.navigate('home');
                            break;
                        case 1:
                            this.props.router.navigate('cart');
                            break;
                        default:
                            this.props.router.navigate('mine');
                    }
                }} value={this.props.active}>
                    <Tabbar.Item icon={<WapHomeO />}>
                        首页
                    </Tabbar.Item>
                    <Tabbar.Item icon={<ShoppingCartO />}>购物车</Tabbar.Item>
                    <Tabbar.Item icon={<UserO />}>我的</Tabbar.Item>
                </Tabbar>
            </div>
        )
    }
    componentDidMount() {
   
    }
}
export default WithRouter(Index);